var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, o) {
        t.__proto__ = o;
    } || function(t, o) {
        for (var e in o) o.hasOwnProperty(e) && (t[e] = o[e]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, o, e, n) {
    var r, i = arguments.length, a = i < 3 ? o : null === n ? n = Object.getOwnPropertyDescriptor(o, e) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(t, o, e, n); else for (var c = t.length - 1; 0 <= c; c--) (r = t[c]) && (a = (i < 3 ? r(a) : 3 < i ? r(o, e, a) : r(o, e)) || a);
    return 3 < i && a && Object.defineProperty(o, e, a), a;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("CustomAdManager"), s = cc._decorator, c = s.ccclass, l = s.property, d = function(o) {
    function t() {
        var t = null !== o && o.apply(this, arguments) || this;
        return t.auto = !0, t.tag = "", t.bindView = null, t.pos = null, t;
    }
    return i(t, o), t.prototype.onLoad = function() {
        r.default.getInstance().add(this.uuid, this);
    }, t.prototype.onDestroy = function() {
        r.default.getInstance().remove(this.uuid);
    }, t.prototype.start = function() {
        this.auto && this.init();
    }, t.prototype.init = function() {
        var t;
        !GA.isPlatform([ GA.Platform.WeChat, GA.Platform.QQ ]) || (t = r.default.getInstance().getOption(this.tag)) && (this.pos = this.node.convertToWorldSpaceAR(cc.v2(t.x, t.y)), 
        r.default.getInstance().initCustomAd({
            adUnitId: t.adUnitId,
            pos: this.pos,
            tag: this.tag,
            size: t.size,
            orientation: t.orientation
        }) && console.log("customAd init success"));
    }, a([ l ], t.prototype, "auto", void 0), a([ l ], t.prototype, "tag", void 0), 
    a([ c ], t);
}(cc.Component);

n.default = d;